import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 导入i18n的主文件
import i18n from './lang/index'
import * as echarts from 'echarts'
import { deepClone } from './utils/tool'
import {
  Button, Row, Col, Menu, MenuItem, Submenu, Form, FormItem, Input, Checkbox, Message, Breadcrumb, BreadcrumbItem, Dropdown, DropdownMenu, DropdownItem, Dialog, Switch, Table, TableColumn, Link,
  Pagination, Popconfirm, Tree, CheckboxGroup, Cascader,
  Select, Option, DatePicker, Upload, RadioGroup, Radio, Tag, Alert, MessageBox, Drawer, Slider, Popover, Tabs, TabPane, Timeline, TimelineItem
} from 'element-ui'
// 导入所有的scss文件
import './assets/style/index.scss'
console.log(process.env.VUE_APP_BASE_API, "---")
import EmojiPick from 'vue-qqemoji-picker'

import './router/permisson'
Vue.use(EmojiPick)
Vue.use(Button)
Vue.use(Row)
Vue.use(Col)
Vue.use(Menu)
Vue.use(MenuItem)
Vue.use(Submenu)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Checkbox)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.use(Dialog)
Vue.use(Switch)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Link)
Vue.use(Pagination)
Vue.use(Popconfirm)
Vue.use(Tree)
Vue.use(CheckboxGroup)
Vue.use(Cascader)
Vue.use(Select)
Vue.use(Option)
Vue.use(DatePicker)
Vue.use(Upload)
Vue.use(RadioGroup)
Vue.use(Radio)
Vue.use(Tag)
Vue.use(Alert)
Vue.use(Drawer)
Vue.use(Slider)
Vue.use(Popover)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Timeline)
Vue.use(TimelineItem)
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm
Vue.config.productionTip = false
Vue.prototype.$bus = new Vue({})//eventBus
Vue.prototype.$echarts = echarts;
// 将i18n挂载到vue实例上

router.beforeEach((to, from, next) => {
  console.log(to.matched.slice(1), "---全局------")

  // let arr=deepClone(to.matched.slice(1));
  // store.dispatch("actBread",arr) 
  next();
})
new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
